CC	= gcc
LINK	= drlink
AS	= as
#CFLAGS	= -Wall -O2 -MMD -mstubs -D__swi -IOS: -mthrowback -DDEBUGGING
CFLAGS	= -Wall -O2 -MMD -mstubs -D__swi -IOS: -mthrowback -mno-poke-function-name -DNDEBUG
LDFLAGS	= -aif -qui -c++ -t
ASFLAGS = -gcc
LIBS	= c:o.stubs gcc:o.libgcc os:o.oslib

o.% : c.%
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $<
o.% : cc.%
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $<

OBJS	= o.pixelfont o.Error o.FontCommon o.FontWrite o.Sprite o.SpritePixel

all:	!RunImage

clean:
	Remove !Depend
	Remove !RunImage
	IfThere o Then Wipe o ~C~FR~V
	IfThere d Then Wipe d ~C~FR~V

!RunImage:	$(OBJS)
	$(LINK) $(LDFLAGS) -o <Wimp$$ScrapDir>.!RunImage $(OBJS) $(LIBS)
	squeeze <Wimp$$ScrapDir>.!RunImage !RunImage
	@Remove <Wimp$$ScrapDir>.!RunImage
	@Remove Mem:ii
	@Remove Mem:i
	@Remove Mem:o
	@Remove Mem:s

o.FontCommon:	c.FontCommon
o.FontRead:	c.FontRead
o.FontWrite:	c.FontWrite
o.Error:	c.Error

o.Sprite:	cc.Sprite
o.SpritePixel:	cc.SpritePixel
o.pixelfont:	cc.pixelfont

# Dynamic dependencies

o.Error:	c.Error
o.Error:	h.Error

o.FontCommon:	c.FontCommon
o.FontCommon:	h.Debug
o.FontCommon:	h.Fontfile

o.FontRead:	c.FontRead
o.FontRead:	h.Debug
o.FontRead:	h.Error
o.FontRead:	h.Fontfile

o.FontWrite:	c.FontWrite
o.FontWrite:	os:h.font
o.FontWrite:	os:h.osfile
o.FontWrite:	os:h.osfscontro
o.FontWrite:	h.Debug
o.FontWrite:	h.Error
o.FontWrite:	h.Fontfile

o.pixelfont:	cc.pixelfont
o.pixelfont:	h.Fontfile
o.pixelfont:	h.Error
o.pixelfont:	h.Sprite
o.pixelfont:	h.SpritePixel

o.Sprite:	cc.Sprite
o.Sprite:	h.Sprite

o.SpritePixel:	cc.SpritePixel
o.SpritePixel:	h.SpritePixel
o.SpritePixel:	h.Sprite

